

#
#
# f = open(r"a.txt","w")
# f.write("test")
# f.close()
#
# try:
#     f = open(r"/Users/graceli/Documents/testFile.txt","a")
#     str = "gaoqi"
#     f.write(str)
# except BaseException as e:
#     print(e)
# finally:
#     f.close()
#
# with open(r"a.txt","a") as f:
#     f.writelines("ab\n cd\n ef\n")
#
# f = open(r"a.txt","w")
# f.write("test2")
# f.close()
#
# with open(r"/Users/graceli/Documents/link.txt","r",encoding="utf-8") as f:
#     while True:
#         fragment = f.readline()
#         if not fragment:
#             break
#         else:
#             print(fragment,end="+")
#
# x = ["我 love u!","尚学堂\n","百战程序员"]
# y = enumerate(x)
# print(x)
# print(list(y))
#
# m = [temp + "#" + str(index) for index, temp in enumerate(x)]
# print(m)

# with open("a.txt","r",encoding="utf-8") as f:
#     print("文件名是:{0}".format(f.name))
#     print(f.tell())
#     print("读取的内容：{0}".format(str(f.readline())))
#     print(f.tell())
#     f.seek(0)
#     print("读取的内容：{0}".format(str(f.readline())))

